// 获取当前环境
export function getEnv() {
  const hostname = window.location.hostname
  const envArr = [
    'dev',
    'test',
    'test2',
    'test3',
    'test4',
    'test5',
    'localhost'
  ]
  let envVal: string | undefined =
    envArr.find(item => hostname.includes(item)) || 'product'
  console.log(envVal)
  // 本地调试时连接的环境
  if (process.env.NODE_ENV === 'development' && envVal === 'localhost') {
    envVal = process.env.VUE_APP_LOCAL_ENV
  }
  console.log(envVal)
  return envVal
}
